#pragma once

#ifndef __REDUCE_ANALYSIS__H__
#define __REDUCE_ANALYSIS__H__
#include "Analysis.h"
#include "../set/Status.h"
#include "../table/ActionTable.h"
#include "../table/GotoTable.h"

namespace compile
{

	// 自下而上分析
	class ReduceAnalysis : public Analysis
	{
	public:
		ReduceAnalysis();
		ReduceAnalysis(string input, Status* status);
		~ReduceAnalysis();

	private:
		stack<string>status_stack; // 状态栈
		stack<string>input_stack; // 输入栈
		stack<string>sign_stack; // 符号栈
		void analysisInput(Status* status);
		static int getStatusNum(string str);
	};
}

#endif